<?php $userModule = Yii::app()->getModule('user');?>

<div class="widget_box">
<div class="block">    
        <div class="block-title"><h2>Welcome <?php echo CHtml::encode(Yii::app()->user->name); ?></h2></div>    
	<div class="block-content">
<ul>
	<li><?php echo CHtml::link('Create New Post',array('/post/create')); ?></li>
	<li><?php echo CHtml::link('Manage Posts',array('/post/admin')); ?></li>
	<li><?php echo CHtml::link('Approve Comments',array('/comment/index')) . ' (' . Comment::model()->pendingCommentCount . ')'; ?></li>
</ul>
<hr/>
<!--
<ul>	
	<li><?php echo CHtml::link('Create New Article',array('/article/create')); ?></li>
	<li><?php echo CHtml::link('Manage Articles',array('/article/admin')); ?></li>
</ul>
<hr/> -->
<ul>	
	<li><?php echo CHtml::link('Create New Category',array('/category/create')); ?></li>
	<li><?php echo CHtml::link('Manage Categories',array('/category/admin')); ?></li>
</ul>
<?php if (Yii::app()->user->checkAccess(Rights::module()->superuserName)) {?>

<hr/>
<ul>
    <li><?php echo CHtml::link($userModule->t('Manage User'), array('/user/admin')); ?></li>
</ul>

<hr/>
<ul>
        <li><?php echo CHtml::link('Rights', array('/rights/index')); ?></li>
</ul> 
<?php }?>
<hr/>
<ul>	
    <li><?php echo CHtml::ajaxLink($userModule->t('Logout'), CHtml::normalizeUrl($userModule->logoutUrl),
                        array(
                            'type'=>'post',
                            'data'=>'YII_CSRF_TOKEN='.Yii::app()->request->csrfToken,
                            'success' => 'function(data) {window.location.reload();}'
                        ),
                        array()
                    );?></li>
</ul>

</div>
    </div>
</div>